package com.es.pay.mailAndMsg;

import java.util.ArrayList;
import java.util.HashMap;

import javax.servlet.http.HttpServletRequest;

import com.opensymphony.webwork.interceptor.ServletRequestAware;
import com.opensymphony.xwork.ActionSupport;

public class InitSendAction  extends ActionSupport implements ServletRequestAware{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	HttpServletRequest request;
	 
   public String execute()throws Exception{
	   
	   MailAndMsgBiz  manegeBiz= new MailAndMsgBiz();
	   ArrayList<HashMap<String,String>> yyyyList  = manegeBiz.getYYYYList();
	   String yyyymm = request.getParameter("yyyymm")==null?"":request.getParameter("yyyymm");
	   String sendType = request.getParameter("sendType")==null?"":request.getParameter("sendType");
	   if("".equals(yyyymm)&&yyyyList.size()>0)
		   yyyymm = yyyyList.get(0).get("code");
	   ArrayList<HrmCtmBean> bean  = manegeBiz.getMenuAllList(yyyymm);
	   request.setAttribute("bean", bean);
	   request.setAttribute("yyyyList", yyyyList);
	   request.setAttribute("yyyymm", yyyymm);
	   request.setAttribute("sendType", sendType);
	   return "success";
   }

   public void setServletRequest(HttpServletRequest request) {
	     this.request = request;
  }
}